package net.trevize.datasetexplorer.dialogs;

import java.awt.BorderLayout;

import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

import net.trevize.datasetexplorer.DatasetExplorer;

/**
 * 
 * 
 * @author Nicolas James <nicolas.james@gmail.com> [[http://njames.trevize.net]]
 * LoadDatasetDialog.java - May 17, 2010
 */

public class LoadDatasetDialog extends JDialog {

	private DatasetExplorer dataset_explorer;
	private JPanel main_panel;
	private JTabbedPane tabbed_pane;
	private JPanel local_filepath_list_explorer_panel;
	private JPanel http_filepath_list_explorer_panel;
	private JPanel iidf_file_explorer_panel;
	private JPanel tar_archive_explorer_panel;
	private JPanel pascalvoc_explorer_panel;

	public LoadDatasetDialog(DatasetExplorer dataset_explorer) {
		this.dataset_explorer = dataset_explorer;
		setModalityType(ModalityType.APPLICATION_MODAL);
		setTitle("Load dataset");
		init();
		setSize(768, 768);
		setLocationRelativeTo(dataset_explorer.getFrame());
	}

	private void init() {
		main_panel = new JPanel();
		main_panel.setLayout(new BorderLayout());
		add(main_panel);

		tabbed_pane = new JTabbedPane();
		main_panel.add(tabbed_pane, BorderLayout.CENTER);
		tabbed_pane.setTabPlacement(JTabbedPane.LEFT);

		local_filepath_list_explorer_panel = new LDDTab1(dataset_explorer);
		tabbed_pane.add("Local filepath list explorer",
				local_filepath_list_explorer_panel);

		http_filepath_list_explorer_panel = new LDDTab2(dataset_explorer);
		tabbed_pane.add("HTTP filepath list explorer",
				http_filepath_list_explorer_panel);

		iidf_file_explorer_panel = new LDDTab3(dataset_explorer);
		tabbed_pane.add("IIDF file explorer", iidf_file_explorer_panel);

		tar_archive_explorer_panel = new LDDTab4(dataset_explorer);
		tabbed_pane.add("TAR archive explorer", tar_archive_explorer_panel);

		pascalvoc_explorer_panel = new LDDTab5(dataset_explorer);
		tabbed_pane.add("PascalVOC explorer", pascalvoc_explorer_panel);
	}

}
